package org.turnlink.sclm.model;

import javax.persistence.Column;
import javax.persistence.Embeddable;
import com.thoughtworks.xstream.annotations.XStreamAlias;
/**
 * ContactContactListId entity. @author MyEclipse Persistence Tools
 */
@XStreamAlias("contactContactListId")
@Embeddable
public class ContactContactListId implements java.io.Serializable {

	// Fields

	private Integer contactId;
	private Integer contactListId;

	// Constructors

	/** default constructor */
	public ContactContactListId() {
	}

	/** full constructor */
	public ContactContactListId(Integer contactId, Integer contactListId) {
		this.contactId = contactId;
		this.contactListId = contactListId;
	}

	// Property accessors

	@Column(name = "contact_id", nullable = false)
	public Integer getContactId() {
		return this.contactId;
	}

	public void setContactId(Integer contactId) {
		this.contactId = contactId;
	}

	@Column(name = "contact_list_id", nullable = false)
	public Integer getContactListId() {
		return this.contactListId;
	}

	public void setContactListId(Integer contactListId) {
		this.contactListId = contactListId;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof ContactContactListId))
			return false;
		ContactContactListId castOther = (ContactContactListId) other;

		return ((this.getContactId() == castOther.getContactId()) || (this
				.getContactId() != null
				&& castOther.getContactId() != null && this.getContactId()
				.equals(castOther.getContactId())))
				&& ((this.getContactListId() == castOther.getContactListId()) || (this
						.getContactListId() != null
						&& castOther.getContactListId() != null && this
						.getContactListId()
						.equals(castOther.getContactListId())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getContactId() == null ? 0 : this.getContactId().hashCode());
		result = 37
				* result
				+ (getContactListId() == null ? 0 : this.getContactListId()
						.hashCode());
		return result;
	}

}